package com.koron.order.application.tools;

import com.koron.bean.system.staff.vo.EamUser;
import com.koron.common.core.config.ThreadLocalContext;
import com.koron.common.core.util.CodeTools;

/**
 * @author jzp
 * @since 2021/10/12
 */
public class ApplicationCodeTools {
    /**
     * 获取检修申请工单编号
     * JXSQTY20210923001
     */
    public static String getApplicationCode() {
        EamUser eamUser = ThreadLocalContext.get();
        String orgPrefix = eamUser.getPrefix();
        if (orgPrefix == null) {
            orgPrefix = "";
        }
        return CodeTools.getCurrAppCodeNo("JXSQ" + orgPrefix, "yyyyMMdd", 3);
    }

    public static String getApplicationExportCode(){
        EamUser eamUser = ThreadLocalContext.get();
        String orgPrefix = eamUser.getPrefix();
        if (orgPrefix == null) {
            orgPrefix = "";
        }
        return CodeTools.getCurrAppCodeNo("JXSQB" + orgPrefix, "yyyyMMdd", 3);
    }


}
